<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet"
	href="asserts/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
<script src="js/jquery-3.2.1.min.js"></script>
</head>
<body>

	<div class="container">
		输入学号:<input type="text" name="sid" id="sid">
		<button type="button" id="queryById">查询</button>
		<table class="table">
			<thead>
				<tr>
					<th>序号</th>
					<th>收获</th>
					<th>疑问</th>
					<th>建议</th>
					<th>提交时间</th>
					<th>提交人</th>
				</tr>
			</thead>
			<tbody id="tbody">

			</tbody>
		</table>
	</div>
	<script>
		$(function() {
			$('#queryById').on('click', function() {
				$.get('daily/query2?sid=' + $('#sid').val(), function(data) {
					bindView(data);
				})
			})
		})

		function bindView(data) {
			var html = '';
			$.each(data, function(i, n) {
				html += '<tr>'
				html += '<td>'+(i+1)+'</td>'
				html += '<td>'+n.daily.gain+'</td>'
				html += '<td>'+n.daily.question+'</td>'
				html += '<td>'+n.daily.suggest+'</td>'
				html += '<td>'+n.daily.subtime+'</td>'
				html += '<td>'+n.student.name+'</td>'
				html += '</tr>'
			})
			$('#tbody').html(html);
		}
	</script>
</body>
</html>